package gamble.notice.command;

import gamble.notice.dao.BoardDaoImp;
import gamble.notice.vo.BoardVO;

import java.io.File;

import java.io.FileOutputStream;

import java.util.UUID;

import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.util.FileCopyUtils;

import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;


@Controller
//@RequestMapping("/update.htm")
public class UpdateController  {
	
private BoardDaoImp dao;
	
	public void setDao(BoardDaoImp dao) {
		this.dao = dao;
	}

	@RequestMapping("/update.htm")
	protected ModelAndView replayMethod(HttpServletRequest req,BoardVO vo) {
		
		//String currentPage=req.getParameter("currentPage");
		vo=dao.getView(vo.getNum());
		ModelAndView mv=new ModelAndView();
		mv.addObject("vo",vo);
		//mv.addObject("currentPage", currentPage);
		mv.setViewName("updateForm");
		return mv;
	}

}
